package com.base.bean;

import java.sql.Blob;

import org.apache.poi.hssf.record.formula.functions.T;

import tool.JsonTool;

/**
 * SessionObj entity. @author MyEclipse Persistence Tools
 */

public class SessionObj implements java.io.Serializable {

	// Fields

	private Integer id;
	private Integer sid;
	private String objName;
	private Integer objId;
	private String objJson;
	private Integer type;
	private Integer state;  

	// Constructors

	/** default constructor */
	public SessionObj() {
	}

	
	public SessionObj(Integer sid, String objName, Integer objId,
			Integer type, Integer state) {
		this.sid = sid;
		this.objName = objName;
		this.objId = objId;
		this.type = type;
		this.state = state;
	}
	
	/** full constructor */
	public SessionObj(Integer sid, String objName, Integer objId,
			String objJson, Integer type, Integer state) {
		this.sid = sid;
		this.objName = objName;
		this.objId = objId;
		this.objJson = objJson;
		this.type = type;
		this.state = state;
	}
	
	public SessionObj(Integer sid, String objName, Integer objId,
			Object object, Integer type, Integer state) {
		this.sid = sid;
		this.objName = objName;
		this.objId = objId;
		try{
		this.objJson = JsonTool.obj2json(object);
		}catch(Exception e){
			e.printStackTrace();
			this.objJson="";
		}
		this.type = type;
		this.state = state;
	}
	

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getSid() {
		return this.sid;
	}

	public void setSid(Integer sid) {
		this.sid = sid;
	}

	public String getObjName() {
		return this.objName;
	}

	public void setObjName(String objName) {
		this.objName = objName;
	}

	public Integer getObjId() {
		return this.objId;
	}

	public void setObjId(Integer objId) {
		this.objId = objId;
	}


	public String getObjJson() {
		return objJson;
	}

	
	public void setObjJson(String objJson) {
		this.objJson = objJson;
	}
	
	
	public void setObjJson(Object object) {
		try{
		this.objJson = JsonTool.obj2json(object);
		}catch(Exception e){
			e.printStackTrace();
			this.objJson="";
		}
	}


	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}


	

}